package com.sai.jsai.module.system.api;

import com.sai.jsai.module.system.api.dto.SysUserRespDTO;
import com.sai.jsai.module.system.api.dto.SysUserRolePermissionDTO;
import com.sai.jsai.module.system.convert.SysUserConvert;
import com.sai.jsai.module.system.dal.entity.SysUser;
import com.sai.jsai.module.system.service.SysUserService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

/**
 * @author jisai
 * @version 0.0.1
 * @Description TODO
 * @createTime 2024/10/01
 */
@Service
public class SysUserApiImpl implements SysUserApi {
    @Resource
    SysUserService sysUserService;

    @Override
    public SysUserRespDTO getByUsername(String username) {
        SysUser sysUser = sysUserService.getByUsername(username);
        return SysUserConvert.INSTANCE.convertToSysUserRespDTO(sysUser);
    }

    @Override
    public SysUserRolePermissionDTO getUserRolePermissionByUsername(String username) {
        return sysUserService.getUserRolePermissionByUsername(username);
    }
}
